<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        window.addEventListener("load",function(){
            var btn1 = document.querySelector('.btn1');
            var btn2 = document.querySelector('.btn2');
            var btn3 = document.querySelector('.btn3');

            btn1.onclick = function(){
                location.assign("https://www.baidu.com")
            }

            btn2.onclick = function(){
                location.replace("https://www.baidu.com")
            }

            btn3.onclick = function(){
                location.reload();
            }

        })
    </script>

    <button class = "btn1">跳转页面</button>
    <button class = "btn2">替换页面</button>
    <button class = "btn3">刷新页面</button>
</body>
</html>